﻿using FreeSql.DataAnnotations;
using Jumei.Common.BaseModel;
using System;

namespace Jumei.Model.Business.MemberManage
{
    /// <summary>
    /// 会员地址表
    /// </summary>
	[Table(Name = "mb_member_address")]
    [Index("idx_{tablename}_01", nameof(ReceiverName), false)]
    [Index("idx_{tablename}_02", nameof(ReceiverPhone), false)]
    public class MemberAddressEntity : EntityFull, ITenant
    {
        /// <summary>
        /// 租户Id
        /// </summary>
        [Column(Position = -10)]
        public long? TenantId { get; set; }

        /// <summary>
        /// 会员Id
        /// </summary>
        public long MemberId { get; set; }

        public MemberEntity Member { get; set; }

        /// <summary>
        ///收货人名称
        /// </summary>
        [Column(StringLength = 50)]
        public string ReceiverName { get; set; }

        /// <summary>
        ///收件人手机
        /// </summary>
        [Column(StringLength = 50)]
        public string ReceiverPhone { get; set; }

        /// <summary>
        /// 最后一级区域Id
        /// </summary>
        public int AreaId { get; set; }

        /// <summary>
        /// 区域Id路径 省级id_市级id_县级Id_ 例如:110000_110100_110101_
        /// </summary>
        [Column(StringLength = 255)]
        public string AreaIdPath { get; set; }

        /// <summary>
        ///收件人地址
        /// </summary>
        [Column(StringLength = 50)]
        public string ReceiverAddress { get; set; }

        /// <summary>
        /// 是否默认地址
        /// </summary>
        public bool IsDefault { get; set; }

        /// <summary>
        /// 启用
        /// </summary>
        public bool Enabled { get; set; } = true;
    }
}
